/**
 * Project: complex.cache
 * 
 * File Created at 2010-7-26
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.complex.Ehcache;

import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * TODO Comment of EHCacheTest
 * @author wb_liang.gao
 *
 */
public class EHCacheTest {
    public static void main(String[] args) {
        /**spring ioc加载*/
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-service.xml");
        /**获取cache1实例*/
        Cache cache1 = (Cache)context.getBean("cache1");
        /**定义Element*/        
        Element element = new Element("key1","value1");
        /**Element存入cache*/
        cache1.put(element);
        
        System.out.println("==============================华丽的开始================================");
        /**cache中取得Element*/
        System.out.println(cache1.get("key1"));
        
    }
}
